package com.hopu.blb_erp.controller;

import com.hopu.blb_erp.entity.PageEntity;
import com.hopu.blb_erp.entity.ProductionProcess;
import com.hopu.blb_erp.service.ProductionProcessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api
@RestController
@Controller
public class productionProcessController {
    @Autowired
    private ProductionProcessService productionProcessService;
    @ApiOperation("查询功能的分页")
    @GetMapping("/ProductionProcess")
    public ResponseEntity<PageEntity<ProductionProcess>> findAllPage(@RequestParam("current") Integer current, @RequestParam("PAGE_SIZE") Integer PAGE_SIZE
            , @RequestParam("orderId") String id){
        int orderId = 0;
        if(!"".equals(id)){ orderId = Integer.parseInt(id); }
        return ResponseEntity.ok(productionProcessService.findAllPage(current,PAGE_SIZE,orderId)) ;
    }
}
